<?php
/**
 *  矿机视频
*/

namespace app\api\model;

use app\admin\model\Images;
use app\admin\model\ModelInfo;
use app\admin\model\Operator;

class MinerVideos extends BaseModel
{
    /**
     *  获取机型名称
     */
    public function modelName(){
        return $this->hasOne(ModelInfo::class, 'id', 'model_id');
    }


    /**
     *  获取创建人
     */
    public function creatorName()
    {
        return $this->hasOne(Operator::class, 'id', 'creator');
    }

    /**
     *  获取封面图片
     */
    public function coverimage()
    {
        return $this->hasOne(Images::class, 'id', 'coverimage_id');
    }

    /**
     *  获取视频
     */
    public function video()
    {
        return $this->hasOne(Images::class, 'id', 'video_id');
    }
}
